package svc

import (
	"github.com/zeromicro/go-zero/zrpc"
	"go-zero-admin/application/job/api/internal/config"
	"go-zero-admin/application/job/rpc/client/taskscheduleservice"
)

type ServiceContext struct {
	Config     config.Config
	JobCronSvc taskscheduleservice.TaskScheduleService
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		JobCronSvc: taskscheduleservice.NewTaskScheduleService(zrpc.MustNewClient(c.JobRpc)),
		Config:     c,
	}
}
